body {
    margin: 0;
    background-color: #f6f6f0;
    overflow: hidden;
}

.jj-page {
    display: flex;
    flex-direction: column;
    height: 100vh;

    .jj-header {
        display: flex;
        align-items: center;

        .jj-tabs {
            --active-line-color: #000;
            --active-line-height: 3px;
            --active-title-color: #000;
            --fixed-active-line-width: 18px;

            flex: 1;

            .adm-tabs-header {
                padding: 13px 0 8px;
                border-bottom: 0;

                .adm-tabs-tab {
                    padding: 0 0 5px;
                    color: #7a8799;
                }

                .adm-tabs-tab-active {
                    color: #000;
                }
            }
        }

        .jj-btn {
            margin-right: 15px;
            padding: 4px 7px;
            border: 1px solid #000;
            box-shadow: 1px 1px #90fad2;
            font-size: 12px;
            line-height: 14px;
        }
    }

    .jj-main {
        flex: 1;
        padding: 8px 16px;
        overflow: scroll;

        .jj-item-selected {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 20px;
            height: 20px;
            background: url('@/assets/selected_gray.png') center / contain no-repeat;
            z-index: 2;
        }

        .jj-item-selected-active {
            background: url('@/assets/selected.png') center / contain no-repeat;
        }

        .jj-item {
            position: relative;
            padding-top: 70.4819%;
            background: url('@/assets/item.png') center / contain no-repeat;
        }

        .jj-item-wrap {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .jj-name {
            color: #7a8799;
            font-size: 12px;
            line-height: 17px;
        }

        .jj-canvas {
            display: grid;
            grid-template-columns: repeat(32, 1fr);
            grid-template-rows: repeat(16, 1fr);
            width: 90%;
            aspect-ratio: 32 / 16;
        }
    }

    .jj-footer {
        display: flex;
        justify-content: center;
        padding: 31px 0 32px;

        .jj-create,
        .jj-collect {
            width: 319px;
            height: 47px;
            background: url('@/assets/btn_create.png') center / contain no-repeat;
        }

        .jj-collect {
            background: url('@/assets/btn_collect.png') center / contain no-repeat;
        }
    }

    .jj-footer-border {
        padding: 18px 0;
        border-top: 1px solid #e3e3e3;
    }

    .jj-footer-column {
        flex-direction: column;
        align-items: center;
    }
}

.jj-page-create {
    display: flex;
    flex-direction: column;

    width: 100vh;
    height: 100vw;
    transform: rotate(90deg) translateY(-100%);
    transform-origin: top left;
    // height: 100vh;

    .jj-main {
        flex: 1;
        display: flex;
        justify-content: space-between;
        padding: 16px 16px 8px;
        background-color: #e3e3e3;

        .jj-action-left {
            display: flex;
            flex-direction: column;
            margin-right: 16px;
        }

        .jj-action-right {
            display: flex;
            flex-direction: column;
            margin-left: 16px;
        }

        .jj-action {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 4px;
            background-color: #fff;
            border-radius: 8px;

            &-divider {
                width: 24px;
                height: 1px;
                margin: 6px 0;
                background: #ededed;
            }

            &-work {
                width: 32px;
                padding-top: 32px;
                background: url('@/assets/icon_create_work.png') top center / 32px no-repeat;
                font-size: 13px;
                text-align: center;
                line-height: 17px;
            }

            &-delete,
            &-undo,
            &-redo,
            &-pencil,
            &-eraser {
                width: 32px;
                height: 32px;
                background: center / contain no-repeat;
            }

            &-delete {
                background-image: url('@/assets/icon_create_delete.png');

                &-active {
                    background-image: url('@/assets/icon_create_delete_active.png');
                }
            }

            &-undo {
                background-image: url('@/assets/icon_create_undo.png');

                &-active {
                    background-image: url('@/assets/icon_create_undo_active.png');
                }
            }

            &-redo {
                background-image: url('@/assets/icon_create_redo.png');

                &-active {
                    background-image: url('@/assets/icon_create_redo_active.png');
                }
            }

            &-pencil {
                background-image: url('@/assets/icon_create_pencil.png');

                &-active {
                    background-image: url('@/assets/icon_create_pencil_active.png');
                }
            }

            &-eraser {
                background-image: url('@/assets/icon_create_eraser.png');

                &-active {
                    background-image: url('@/assets/icon_create_eraser_active.png');
                }
            }
        }

        .jj-canvas-wrap {
            position: relative;
            width: 100%;

            .jj-canvas-absolute {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                display: flex;
                justify-content: center;
                align-items: center;

                .jj-canvas {
                    flex: 1;
                    display: grid;
                    grid-template-columns: repeat(32, 1fr);
                    grid-template-rows: repeat(16, 1fr);
                    aspect-ratio: 32 / 16;
                    max-width: 100%;
                    max-height: 100%;
                }
            }
        }
    }

    .jj-footer {
        display: flex;
        justify-content: space-between;
        padding: 16px 24px 16px 16px;
        background-color: #f6f6f0;
        font-size: 0;

        .jj-color {
            width: 32px;
            height: 32px;
            border: 2px solid #f6f6f0;
            border-radius: 32px;
        }

        .jj-color-active {
            background: url('@/assets/icon_check.png') center / 20px no-repeat;
            border-color: #6cefbf;
        }

        .jj-btn {
            position: relative;
            width: 63px;
            height: 35px;

            &-save {
                background: url('@/assets/btn_save.png') center / contain no-repeat;
            }

            &-show {
                background: url('@/assets/btn_show.png') center / contain no-repeat;
            }

            &::before {
                content: '';
                position: absolute;
                right: -2px;
                bottom: -2px;
                width: 51px;
                height: 2px;
                background-color: #6cefbf;
            }

            &::after {
                content: '';
                position: absolute;
                right: -2px;
                bottom: -2px;
                width: 2px;
                height: 29px;
                background-color: #6cefbf;
            }
        }
    }
}

/**
 * Helper
 */
// Space
@space-values: 0, 8, 16, 24;

.generate-space(@values, @index: length(@values)) when (@index > 0) {
    @value: extract(@values, @index);

    // margin
    .m-@{value} {
        margin: ~'@{value}px' !important;
    }

    // margin-top
    .mt-@{value} {
        margin-top: ~'@{value}px' !important;
    }

    // margin-right
    .mr-@{value} {
        margin-right: ~'@{value}px' !important;
    }

    // margin-bottom
    .mb-@{value} {
        margin-bottom: ~'@{value}px' !important;
    }

    // margin-left
    .ml-@{value} {
        margin-left: ~'@{value}px' !important;
    }

    // margin-horizontal
    .mh-@{value} {
        margin-left: ~'@{value}px' !important;
        margin-right: ~'@{value}px' !important;
    }

    // margin-vertical
    .mv-@{value} {
        margin-top: ~'@{value}px' !important;
        margin-bottom: ~'@{value}px' !important;
    }

    // padding
    .p-@{value} {
        padding: ~'@{value}px' !important;
    }

    // padding-top
    .pt-@{value} {
        padding-top: ~'@{value}px' !important;
    }

    // padding-right
    .pr-@{value} {
        padding-right: ~'@{value}px' !important;
    }

    // padding-bottom
    .pb-@{value} {
        padding-bottom: ~'@{value}px' !important;
    }

    // padding-left
    .pl-@{value} {
        padding-left: ~'@{value}px' !important;
    }

    // padding-horizontal
    .ph-@{value} {
        padding-left: ~'@{value}px' !important;
        padding-right: ~'@{value}px' !important;
    }

    // padding-vertical
    .pv-@{value} {
        padding-top: ~'@{value}px' !important;
        padding-bottom: ~'@{value}px' !important;
    }

    .generate-space(@values, (@index - 1));
}
.generate-space(@space-values);
